<%--
  Created by IntelliJ IDEA.
  User: empty
  Date: 2025/5/22
  Time: 21:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
  <title>健康信息登记</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Segoe UI', sans-serif;
    }

    body {
      background: linear-gradient(135deg, #f0f7ff 0%, #e0ecff 100%);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 20px;
    }

    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 30px;
      padding: 15px 0;
      border-bottom: 1px solid #d0e0ff;
    }

    .header h1 {
      color: #2c5282;
      font-size: 28px;
      font-weight: 600;
    }

    #logout button {
      background-color: #6c757d;
      color: white;
      border: none;
      padding: 10px 18px;
      border-radius: 6px;
      cursor: pointer;
      transition: background-color 0.3s;
      font-size: 14px;
      letter-spacing: 0.5px;
    }

    #logout button:hover {
      background-color: #545b62;
    }

    #app {
      background: white;
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(50, 100, 180, 0.1);
      padding: 35px 40px;
      width: 100%;
      max-width: 800px;
      margin: 0 auto;
    }

    #app h2 {
      color: #2c5282;
      font-size: 24px;
      margin-bottom: 28px;
      padding-left: 12px;
      border-left: 4px solid #4a89dc;
    }

    form {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      grid-gap: 25px;
    }

    label {
      display: flex;
      flex-direction: column;
    }

    label span {
      font-size: 14px;
      color: #555;
      margin-bottom: 8px;
      font-weight: 500;
    }

    input {
      padding: 14px 18px;
      border: 1px solid #e0e6f0;
      border-radius: 8px;
      font-size: 16px;
      transition: border-color 0.3s, box-shadow 0.3s;
    }

    input:focus {
      outline: none;
      border-color: #4a89dc;
      box-shadow: 0 0 0 3px rgba(74, 137, 220, 0.15);
    }

    button[type="submit"] {
      background-color: #4a89dc;
      color: white;
      border: none;
      padding: 16px 24px;
      border-radius: 8px;
      font-size: 16px;
      cursor: pointer;
      transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
      font-weight: 500;
      margin-top: 20px;
      box-shadow: 0 4px 12px rgba(74, 137, 220, 0.2);
      grid-column: 1 / -1;
    }

    button[type="submit"]:hover {
      background-color: #3672c4;
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(74, 137, 220, 0.3);
    }

    button[type="submit"]:active {
      transform: translateY(0);
    }

    .message {
      margin: 20px auto 0;
      padding: 14px;
      border-radius: 6px;
      text-align: center;
      font-size: 14px;
      max-width: 800px;
      width: 100%;
      animation: fadeIn 0.3s ease;
    }

    .message:empty {
      display: none;
    }

    .message.error {
      background-color: #ffe6e6;
      color: #d92b2b;
    }

    .message.success {
      background-color: #e6f7ea;
      color: #1a7930;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }
  </style>
</head>
<body>
<div class="header">
  <h1>健康信息登记系统</h1>
  <div id="logout">
    <form action="user-community" name="action" method="post">
      <input type="hidden" name="action" value="return">
      <button type="submit">返回健康信息首页</button>
    </form>
  </div>
</div>

<div id="app">
  <h2>填写健康信息</h2>
  <form action="add-information" method="post">
    <label>
      <span>健康档案ID:</span>
      <input type="text" name="health_id">
    </label>
    <label>
      <span>姓名:</span>
      <input type="text" name="health_name" required>
    </label>
    <label>
      <span>性别:</span>
      <input type="text" name="gender" placeholder="男/女" required>
    </label>
    <label>
      <span>年龄:</span>
      <input type="text" name="age" required>
    </label>
    <label>
      <span>慢性病史:</span>
      <input type="text" name="chronic_diseases" placeholder="如高血压、糖尿病等">
    </label>
    <label>
      <span>过敏史:</span>
      <input type="text" name="allergies" placeholder="如药物、食物等">
    </label>
    <button type="submit">上传健康信息</button>
  </form>
</div>

<div class="message ${message ? 'error' : ''}">${message}</div>
</body>
</html>

